﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data;

namespace FarmacieDAL
{
    public class StocCriticManager
    {
        private static List<Stoc_Critic> toateStocurileCritice;
        private static FarmacieEntities entities;

        public static void Initialize(FarmacieEntities entitiesContext)
        {
            toateStocurileCritice = new List<Stoc_Critic>();
            entities = entitiesContext;

            toateStocurileCritice = entities.Stoc_Critic.ToList();
        }

        public static void Refresh()
        {
            toateStocurileCritice.Clear();
            entities.Refresh(RefreshMode.StoreWins, entities.Stoc_Critic);
            toateStocurileCritice.AddRange(entities.Stoc_Critic);
        }

        public static List<Stoc_Critic> ToateStocurileCritice
        {
            get
            {
                return toateStocurileCritice;
            }
        }
    }
}
